#include<bits/stdc++.h>
#define LL long long
#define LLL __int128
#define uint unsigned
#define ldb long double
#define uLL unsigned long long
using namespace std;
const int INF=1e9;
string S,s,ans;
char c,a[30][30];
int x,y,sx,sy,nx,ny,mn;
signed main(){
	cin.tie(0)->sync_with_stdio(0);
	freopen("snake.in","r",stdin);
	freopen("snake.out","w",stdout);
    cin>>S,s="BGR";
    const auto qry=[&](int x,int y,int p,char r){
        if(a[x][y]!=S[p])return;
        if(x%3==0&&y%3==0&&p+1<S.length()&&S[p]!=S[p+1])return;
        int d=(x-15)*(x-15)+(y-15)*(y-15);
        if(d<mn)nx=x,ny=y,mn=d,c=r;
    };
    do{
        for(int i=0;i<30;++i)
            if(i%3==0)fill(a[i],a[i]+30,s[0]);
            else if(i%6<3)for(int j=0;j<30;++j)a[i][j]=s[j%3];
            else for(int j=0;j<30;++j)a[i][j]=s[(30-j)%3];
        bool flg=1;
        mn=INF,ans="";
        for(int i=0;i<30;++i)
            for(int j=0;j<30;++j)
                qry(i,j,0,0);
        sx=nx,sy=ny,x=nx,y=ny;
        for(int i=1;i<S.length();++i){
            mn=INF;
            if(x)qry(x-1,y,i,'U');
            if(x<29)qry(x+1,y,i,'D');
            if(y)qry(x,y-1,i,'L');
            if(y<29)qry(x,y+1,i,'R');
            if(mn>=INF){
                flg=0;break;
            }
            else ans+=c,x=nx,y=ny;
        }
        if(flg){
            cout<<"30 30\n";
            for(int i=0;i<30;++i,cout<<'\n')
                for(int j=0;j<30;++j)
                    cout<<a[i][j];
            cout<<sx+1<<' '<<sy+1<<'\n'<<ans<<'\n';
            return 0;
        }
    }while(next_permutation(s.begin(),s.end()));
	return 0;
}
/*
*/